#ifndef VERSIONMANAGER_MANAGER_H_INCLUDED
#define VERSIONMANAGER_MANAGER_H_INCLUDED

#include "vm_gui.h"
#include "vm_data.h"

class IConfigTool;

namespace versionmgr
{

/**
 * @class SettingsDialogBase
 */
class SettingsDialogBase : public SettingsDialogGui
{
protected:
	Settings     m_settings;
	IConfigTool* m_cfg;

public:
	SettingsDialogBase(wxWindow* parent, const Settings& settings, bool bUseExternalFile, IConfigTool* cfg);

	const Settings& GetSettings() const { return m_settings; }
	bool UseExternalSettingFile() const { return m_bUseExternalSettingFile; }

protected:
	bool SaveSettings();
};

/**
 * @class ProjectSettingsDialog
 */
class ProjectSettingsDialog : public SettingsDialogBase
{
protected:
	wxString m_sProjectPath;

public:
	ProjectSettingsDialog(wxWindow* parent, const wxString& sProjectPath, const Settings& settings, bool bUseExternalFile, IConfigTool* cfg);
	~ProjectSettingsDialog();

protected:
	// Virtual event handlers
	virtual void OnOK( wxCommandEvent& event );
};

/**
 * @class GlobalSettingsDialog
 */
class GlobalSettingsDialog : public SettingsDialogBase
{
public:
	GlobalSettingsDialog(wxWindow* parent, const Settings& settings, bool bUseExternalFile, IConfigTool* cfg);
	~GlobalSettingsDialog();

protected:
	// Virtual event handlers
	virtual void OnOK( wxCommandEvent& event );
};

/**
 * @class VersionDialog
 */
class VersionDialog : public VersionDialogGui
{
protected:
	Version      m_version;
	IConfigTool* m_cfg;

public:
	VersionDialog(wxWindow* parent, const VersionData& versionData, IConfigTool* cfg);
	~VersionDialog();

	Version GetVersion() const { return m_version; }

protected:
	// Virtual event handlers
	virtual void OnCheckCanEdit( wxCommandEvent& event );
	virtual void OnIncMajor( wxCommandEvent& event );
	virtual void OnIncMinor( wxCommandEvent& event );
	virtual void OnIncRelease( wxCommandEvent& event );
	virtual void OnIncBuild( wxCommandEvent& event );
	virtual void OnOK( wxCommandEvent& event );
};

bool WriteVersionFile(const VersionData& versionData);

}; // namespace versionmgr

#endif // VERSIONMANAGER_MANAGER_H_INCLUDED
